//
//  CollectGameListApi.m
//  gamebox_qpp
//
//  Created by 赵隆杰 on 2021/12/20.
//

#import "CollectGameListApi.h"

@implementation CollectGameListApi


- (NSString *)requestUrl {
    return @"ios/game-collect/selectById";
}

- (YTKRequestMethod)requestMethod {
    return YTKRequestMethodGET;
}

- (id)requestArgument {
    
    NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
    
    params[@"userId"] = [LocalData fetchUserInfo].userId;
    params[@"pageNum"] = @(self.pageNum);
    params[@"pageSize"] = @(self.pageSize);

    return params;
}

- (void)requestCompleteFilter
{
    [super requestCompleteFilter];
    if (self.success) {
        NSMutableArray *temArr = [NSMutableArray array];
        for (NSDictionary *dict in self.resArr) {
            NSDictionary *modelDict = dict[@"iosGame"];
            GameModel *model = [GameModel mj_objectWithKeyValues:modelDict];
            [temArr addObject:model];
        }
        self.modelList = [NSArray arrayWithArray:temArr];
    }
}


@end
